package com.example.teesystem.common.exception;

import com.example.teesystem.common.utils.ResultCode;
import lombok.experimental.UtilityClass;

import java.util.Collection;

@UtilityClass
public class Assert {
    public void notNull(ResultCode resultCode, Object... values) {
        for (Object val : values) {
            if (val == null) {
                throw new CustomException(resultCode);
            }
        }
    }
    
    public void notEmpty(Collection collection, ResultCode resultCode) {
        if(collection == null || collection.size() == 0) {
            throw new CustomException(resultCode);
        }
    }
}
